//
//  UserModel.m
//  i读
//
//  Created by 朱经扬 on 15/11/11.
//  Copyright © 2015年 123. All rights reserved.
//

#import "UserModel.h"
//#import "MJExtension.h"
@implementation UserModel

- (NSString *)description{
    return [NSString stringWithFormat:@"UserModer:\n userId = %@ \n phone = %@ \n nickName = %@ \n headImg = %@ \n gender = %@ \n hobby = %@ \n loginPwd = %@ \n occupation = %@ \n signature = %@ \n target = %@ \n",@(self.userId),self.phone,self.nickName,self.headImg,self.gender,self.hobby,self.loginPwd,self.occupation,self.signature,@(self.target)];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    self = [super init];
    if (self) {
        self.userId = [aDecoder decodeIntegerForKey:@"userId"];
        self.phone = [aDecoder decodeObjectForKey:@"phone"];
        self.nickName = [aDecoder decodeObjectForKey:@"nickName"];
        self.headImg = [aDecoder decodeObjectForKey:@"headImg"];
        self.gender = [aDecoder decodeObjectForKey:@"gender"];
        self.hobby = [aDecoder decodeObjectForKey:@"hobby"];
        self.loginPwd = [aDecoder decodeObjectForKey:@"loginPwd"];
        self.occupation = [aDecoder decodeObjectForKey:@"occupation"];
        self.signature = [aDecoder decodeObjectForKey:@"signature"];
        self.target = [aDecoder decodeIntegerForKey:@"target"];

    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeInteger:self.userId forKey:@"userId"];
    [aCoder encodeObject:self.phone forKey:@"phone"];
    [aCoder encodeObject:self.nickName forKey:@"nickName"];
    [aCoder encodeObject:self.headImg forKey:@"headImg"];
    [aCoder encodeObject:self.gender forKey:@"gender"];
    [aCoder encodeObject:self.hobby forKey:@"hobby"];
    [aCoder encodeObject:self.loginPwd forKey:@"loginPwd"];
    [aCoder encodeObject:self.occupation forKey:@"occupation"];
    [aCoder encodeObject:self.signature forKey:@"signature"];
    [aCoder encodeInteger:self.target forKey:@"target"];
}

@end
